<#if  user?? && user.linkType?? && (user.linkType == "wzgly" || user.linkType == "ssgly") > <!--赛事管理员 和 系统管理员-->
<#include "sshdXqListTemplate.html">
<#else>
	您没有权限查看该功能
</#if>
<#macro xmtopic>
${matchProject.matName!}
</#macro>
<#macro toolbarButton> 
<style>
.xm_button .el-button1{
	background-color: #FDBF19;
	border-color: #FDBF19;
}
.xm_button .el-button2{
	background-color: #FF6F00;
	border-color: #FF6F00;
}
.xm_button .el-button3{
	background-color: #ED413D;
	border-color: #ED413D;
}
.xm_button .el-button4{
	background-color: #A0C612;
	border-color: #A0C612;
}
.xm_button .el-button5{
	background-color: #ED413D;
	border-color: #ED413D;
}
.xm_button .el-button6{
	background-color: #3C91EA;
}
.xm_button img {margin-right: 6px;width: 20px;}
</style>
<button  type="button" class="el-button1" onclick="reflushWindow(true);"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/shuaxin2.png"/>刷新</span></button>
<button  type="button" class="el-button2" onclick="downLoadXmExcel();"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/daochu2.png"/>导出excel</span></button>
<button  type="button" class="el-button3" onclick="settingProState('取消推荐','wzt');"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/quxiao.png"/>取消推荐</span></button>
<button  type="button" class="el-button4" onclick="settingProState('学校推荐','xxtj');"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/tuijian.png"/>学校推荐</span></button>
<button  type="button" class="el-button5" onclick="settingProState('退出决赛','tcjs');"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/tuichu.png"/>退出决赛</span></button>
<button  type="button" class="el-button6" onclick="settingProState('进入决赛','jrjs');"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/jiangbei.png"/>进入决赛</span></button>
</#macro>
<#macro toolbarSearch>
<#if user.linkType == "ssgly" || user.linkType == "wzgly"> <!--赛事管理 -->
<style>
.xm_search {
    padding: 20px;
    width: 1200px;
}
.xm_search .el-input__inner {
    background-color: #fff;
    background-image: none;
    border: 1px solid #d7e5ea;
    color: #1f2d3d;
    height: 35px;
    padding-left: 10px;
    width: 105px;
    font-size: 15px;
    border-radius: 5px;
}
.xm_search .txt_span{
    font-size:16px;
}
.xm_search .input_span{
    margin-left: 15px;
    margin-right: 15px;
}
</style>
<form id="searchXmForm">
<span class="txt_span">项目类型:</span>
<span class="input_span">
	<select  class="el-input__inner" name="xmArtType" style=" width: 130px;">
		<option value ="">全部</option>
	<#list matchTypeList as type>
  		<option value ="${type.value!}"  <#if xmArtType?? && type.value == xmArtType> selected </#if> >${type.name!}</option>
	</#list>  
	</select>
</span>	
<span class="txt_span">单位名称:</span>
<span class="input_span">
	<select  class="el-input__inner" name="xmCompanyName">
		<option value ="">全部</option>
	<#list companyList as type>
  		<option value ="${type.value!}"  <#if xmCompanyName?? && type.value == xmCompanyName> selected </#if> >${type.name!}</option>
	</#list>  
	</select>
</span>	
<span class="txt_span">项目状态:</span>
<span class="input_span">
	<select  class="el-input__inner" name="xmProcessStatus">
		<option value ="">全部</option>
	<#list processStatuList as type>
  		<option value ="${type.value!}" <#if xmProcessStatus?? && type.value == xmProcessStatus> selected </#if>>${type.name!}</option>
	</#list>  
	</select>
</span>	
<span class="txt_span">项目名称:</span>
<span class="input_span">
	<input type="text" placeholder="全部" class="el-input__inner" name="xmName" value="${(xmName)!''}"/>
	<span class="btnsearchIcon" onclick="searchXmByParam('searchXmForm')" style="cursor: pointer;background: url(static/cms/www/default/img/sshd/search.png);height: 24px;width: 21px;float: right;margin-right: 25%;margin-top: 5px;"></span>
</span>
</form>
</#if>
</#macro>
<#macro tableDataList>
  <tbody>
<#if dataList??>
  <#list dataList as data>
    <tr>  
	    <td name="xmId" class="g_checkbox"><input name="csxmId" type="checkbox" value="${data.id!}"></input></td>
	    <td>
	    <#if (data.artname)??&&data.artname?length gt 10>  
    		${data.artName?substring(0,10)}...  
		<#else>
			${data.artName!}   
		</#if>  
	    </td>
	    <td><@jmax.dc key="MATCH_ART_TYPE" code="${data.artType!}" /></td>
	    <td><@jmax.dc key="MATCH_COMPANY_INFO" code="${data.companyName!}" /></td> 
	    <td><@jmax.dc key="MATCH_PROCESS_STATU" code="${data.processStatus!}" /></td>  
	    <td>${(data.countScore)!0}</td>  
	    <td>
		<a onclick="editsshdzxqXM('${data.artType!}',${data.id!},'sshdCsXmShow')">[项目详情]</a>
		</td>  
	</tr>  
  </#list>
 </#if>
</tbody>
</#macro>
<#macro contentListShow>
	<!--角色控制-->
	<#include "sshdXqTable.html">
	<@createTable styleClass='container1100' tabfields = ['项目名称','项目类型','单位名称','项目状态','项目得分','操作'] isCheckBox=true  checkBoxName='csxmId' func=tableDataList  funcButton=buttonOprator1/>
	<#include "pager.html">
</#macro>
<#macro buttonOprator1>
</#macro>
<#macro buttonOprator>
</#macro>
<#macro extendJs>
<script>
function settingProState(txt,status) {
	var ids = ""; 
	
	$('input[name="csxmId"]:checked').each(function(){ 
		ids += $(this).val() +",";
	}); 
	if(ids == "") {
		$.alert(ids.length==0 ?'你还没有选择任何内容！':ids); 
		return;
	}
	$.confirm({
    title: '提示',
    content: '你确认该项目要'+txt+'吗?',
    confirm: function(){
		$.ajax({
		     type: 'POST',
		     url: "matchManager.do?processStaus&matchProjectId=${(matchProject.id)!}",
		     dataType : 'json',  
		     data: {ids:ids,status:status},
		     success: function(data) {
		         alertMessage(data,true,null);
	         },
     	    error:function(data,textstatus){
     	    	errorMessage();
           }  
		  });
    },
    cancel: function(){
    }
});
}

function searchXmByParam(formId) {
	var param = getFormParam(formId);
	var url = "matchManager.do?sshdSysAllXm&sshdId=${matchProject.id!}&pageNo=1";
	window.location.href = url  + param;
}

function getFormParam(formId) {
	var param = "";
	$("#" + formId + " input").each(function(){
		if(this.name == "xmName") {
			param = param + "&" + this.name + "=" + encodeURI(encodeURI(this.value));
		 } else {
		 	param = param + "&" + this.name + "=" + this.value;
		 }
	});	
	$("#" + formId + " select").each(function(){
		 param = param + "&" + this.name + "=" + this.value;
	});
	return param;
}

function downLoadXmExcel() {
	var url = "matchManager.do?downLoadAllXm&sshdId=${matchProject.id!}"+getFormParam('searchXmForm');
	console.log(url);
	if($('#downloadForm')) $('#downloadForm').remove();
	var downloadForm  = $("<form id=\"downloadForm\">");//定义一个form表单
	downloadForm.attr("style","display:none");
	downloadForm.attr("target","");
	downloadForm.attr("method","post");
	downloadForm.attr("action",url);
	var input1=$("<input>");
	input1.attr("type","hidden");
	input1.attr("name","downLoad");
	input1.attr("value",(new Date()).getMilliseconds()); 
	$("body").append(downloadForm);//将表单放置在web中
	downloadForm.append(input1);
	downloadForm.submit();//表单提交
	
}
</script>
<#include "sshdXqXmJs.html"> 
<@sshdXqXmJs/>
</#macro>
